package com.zhu.instructions.loads;
import com.zhu.instructions.base.NoOperandsInstruction;
import com.zhu.rtda.Frame;
import com.zhu.rtda.InstanceOop;

/**
 * ALOAD_3 指令
 *
 * 操作码: 0x2d
 * 操作数: 无
 * 功能: 将局部变量表索引 3 处的引用加载到操作数栈顶。
 * 格式: aload_3
 */
public class ALOAD_3 extends NoOperandsInstruction {

    @Override
    public void execute(Frame frame) {
        InstanceOop ref = (InstanceOop) frame.getLocalVars().getRef(3);
        frame.getOperandStack().pushRef(ref);
    }
}
